Skip to content

WIP: Add Azure VAP #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

WIP: Add Azure VAP #321

wants to merge 1 commit into from

Conversation

racheljpg
Copy link

Hello! This is a WIP to ask some questions on the generation for the Azure VAP to stop the deletion of Azure InfraClusters/IdentityReferences/whatever else we want to include. Thanks!

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2024
Copy link

openshift-ci bot commented Oct 17, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

openshift-ci bot commented Oct 17, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nrb for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Author

@racheljpg racheljpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @damdo, pinging you here as I have some questions about this and thought it was easier to ask here on a draft PR

apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingAdmissionPolicy
metadata:
name: openshift-cluster-api-protect-azureclusteridentities
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm presuming this has to be it's own separate thing, and that it cannot be included in the VAP above by adding azureclusteridentities as a resource?

apiVersion: config.openshift.io/v1
kind: Infrastructure
validations:
- expression: '!(oldObject.metadata.name == params.status.infrastructureName)'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aware that this message isn't the most useful thing here - will update once I've tidied up a little

parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azureclusteridentities
validationActions:
- Deny
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to include anything else that we don't want to be deleted, or are the cluster and the identity reference enough?
(ignore the lack of a new line, will fix:) )

@damdo
Copy link
Member

damdo commented Oct 22, 2024

/test ?

Copy link

openshift-ci bot commented Oct 22, 2024

@damdo: The following commands are available to trigger required jobs:

  • /test e2e-azure
  • /test e2e-azure-capi-techpreview
  • /test e2e-azure-serial
  • /test images
  • /test security
  • /test unit

The following commands are available to trigger optional jobs:

  • /test e2e-azure-manual-oidc
  • /test e2e-azure-techpreview
  • /test okd-scos-images
  • /test verify-commits

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure
  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure-capi-techpreview
  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure-serial
  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure-techpreview
  • pull-ci-openshift-cluster-api-provider-azure-master-images
  • pull-ci-openshift-cluster-api-provider-azure-master-security
  • pull-ci-openshift-cluster-api-provider-azure-master-unit
  • pull-ci-openshift-cluster-api-provider-azure-master-verify-commits

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

openshift-ci bot commented Oct 22, 2024

@damdo: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test e2e-azure
  • /test e2e-azure-capi-techpreview
  • /test e2e-azure-serial
  • /test images
  • /test security
  • /test unit

The following commands are available to trigger optional jobs:

  • /test e2e-azure-manual-oidc
  • /test e2e-azure-techpreview
  • /test okd-scos-images
  • /test verify-commits

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure
  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure-capi-techpreview
  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure-serial
  • pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure-techpreview
  • pull-ci-openshift-cluster-api-provider-azure-master-images
  • pull-ci-openshift-cluster-api-provider-azure-master-security
  • pull-ci-openshift-cluster-api-provider-azure-master-unit
  • pull-ci-openshift-cluster-api-provider-azure-master-verify-commits

In response to this:

/test pull-ci-openshift-cluster-api-provider-azure-master-e2e-azure-capi-techpreview

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@damdo
Copy link
Member

damdo commented Oct 22, 2024

/retitle WIP: Add Azure VAP

@openshift-ci openshift-ci bot changed the title Add Azure VAP WIP: Add Azure VAP Oct 22, 2024
@damdo
Copy link
Member

damdo commented Oct 22, 2024

/test e2e-azure-capi-techpreview

@racheljpg racheljpg force-pushed the azureVAP branch 2 times, most recently from c431373 to 37e035f Compare October 23, 2024 13:16
matchConstraints:
resourceRules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
Copy link
Member

@damdo damdo Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to match the apiGroup of a Secret, which is the core one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated!

@racheljpg racheljpg force-pushed the azureVAP branch 2 times, most recently from f5e6f18 to 13aa469 Compare October 24, 2024 13:30
message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1beta1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change all of these to v1, and make sure the syntax/fields are ok with v1

validationActions:
- Deny
---
apiVersion: admissionregistration.k8s.io/v1beta1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here

@@ -11025,6 +11025,129 @@ data:
targetPort: webhook-server
selector:
cluster.x-k8s.io/provider: infrastructure-azure
---
apiVersion: admissionregistration.k8s.io/v1beta1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here

message: InfraCluster resources with metadata.name corresponding to the cluster
infrastructureName cannot be deleted.
---
apiVersion: admissionregistration.k8s.io/v1beta1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here

@@ -11023,3 +11023,126 @@ spec:
targetPort: webhook-server
selector:
cluster.x-k8s.io/provider: infrastructure-azure
---
apiVersion: admissionregistration.k8s.io/v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is wrong on these YAMLs (only on this file openshift/infrastructure-components-openshift.yaml), they should be starting at the beginning of the line

Comment on lines 11135 to 11150
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: openshift-cluster-api-protect-azureclustersecrets
spec:
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: openshift-cluster-api
paramRef:
name: cluster
parameterNotFoundAction: Deny
policyName: openshift-cluster-api-protect-azureclustersecrets
validationActions:
- Deny
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation of this file is off (too much on the right end side, which is throwing off the parser with:
E1025 10:54:25.739990 1 controller.go:316] "Reconciler error" err="error during reconcile: error applying CAPI provider \"azure\" components: error getting provider components: error parsing provider component at position 32 to unstructured: error while decoding YAML to runtime object: error while decoding YAML object: yaml: line 29: could not find expected ':'" controller="CapiInstallerController" controllerGroup="config.openshift.io" controllerKind="ClusterOperator" ClusterOperator="cluster-api" namespace="" name="cluster-api" reconcileID="ff9c7798-9de6-4629-a95e-c358aaecf1f2" E1025 10:54:29.500601 1 kind.go:71] "if kind is a CRD, it should be installed before calling Start" err="failed to get restmapping: no matches for kind \"AzureCluster\" in version \"infrastructure.cluster.x-k8s.io/v1beta1\"" logger="controller-runtime.source.EventHandler" kind="AzureCluster.infrastructure.cluster.x-k8s.io"

@nrb
Copy link

nrb commented Nov 4, 2024

#322 now includes the VAPs; I couldn't get around generating the manifests without the VAPs once I updated manifests-gen, it would cause a verification job to fail because the committed version and the generated version were different.

Along those lines, I wonder if this particular PR should be done as a Kustomization patch, since infrastructure-components{,-openshift}.yaml, plus the resulting ConfigMap, are generated by manifests-gen.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 16, 2025
@openshift-merge-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@damdo
Copy link
Member

damdo commented Jan 16, 2025

@racheljpg are you still planning to finish this off?

@racheljpg
Copy link
Author

racheljpg commented Jan 16, 2025

@damdo yes, I think we still need this! Will pick it back up ASAP

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 17, 2025
@damdo
Copy link
Member

damdo commented Apr 17, 2025

@racheljpg when we do this, we'll need to also need to update the other providers to use v1 instead of v1beta1

@racheljpg
Copy link
Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 17, 2025
Copy link

openshift-ci bot commented Jul 1, 2025

@racheljpg: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/hypershift-e2e-aks 050cca8 link true /test hypershift-e2e-aks
ci/prow/e2e-azure-serial-1of2 050cca8 link true /test e2e-azure-serial-1of2
ci/prow/e2e-azure-serial-2of2 050cca8 link true /test e2e-azure-serial-2of2

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@damdo
Copy link
Member

damdo commented Jul 17, 2025

@racheljpg We should likely move these to cluster-capi-operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants